<template>
    <div class="dashboard-section">
        <div class="section-header">
            <h2>{{ title }}</h2>
            <el-button text @click="$emit('view-all')"></el-button>
        </div>
        <slot></slot>
    </div>
</template>

<script setup>
defineProps({
    title: {
        type: String,
        required: true
    }
})

defineEmits(['view-all'])
</script>

<style scoped>
.dashboard-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    color: #303133;
    margin: 0;
}
</style>